package com.leoman.spinningmachine.util;

import android.os.Environment;

import com.leoman.helper.util.LogUtil;

import java.io.File;

/**
 * Created by Administrator on 2018-05-31.
 */

public class FileUtil {


    /**
     *
     * @return
     */
    public static String getSdCardPath(){
        File sdDir = null;
        if(isSdCardExist()) {
            sdDir = Environment.getExternalStorageDirectory();//获取跟目录
        }
        LogUtil.json("gen:"+sdDir.toString());
        return sdDir.toString();
    }

    public static boolean isSdCardExist(){
        boolean sdCardExist = Environment.getExternalStorageState()
                .equals(android.os.Environment.MEDIA_MOUNTED);//判断sd卡是否存在
        return sdCardExist;
    }
}
